<?
session_start();
if (!isset($_SESSION["sess_Username"])) { 
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <script>
	alert('กรุณาทำการ Login เข้าระบบก่อน');
	</script>
	<meta http-equiv='refresh' content='0;URL=admin_login.php'>
<? 
}
include "connectdb.php" ;
		$SQL_SELECT_COUNT_USERTYPE = "SELECT count(user_typeid) FROM ag_usertype ;";
		$cuser = mysql_query($SQL_SELECT_COUNT_USERTYPE);
		$cuser2 = mysql_result($cuser,0);
		
	
		$p=0;
		$SQL_SELECT_USERTYPE = "SELECT * FROM ag_usertype ORDER BY user_typeid";
        $result = mysql_query($SQL_SELECT_USERTYPE);
        while($rs = mysql_fetch_array( $result )) //นำค่าี่ที่ผ่านการคิวรี่จากตัวแปร $result มาทำการวนลูปเพื่อเอาค่าในแต่ละฟิลด์ออกมาโชว์แสดงผล
			{ $user_typeid = $rs[user_typeid];									
			  $user_type = $rs[user_type];	
			
				$gpara[$p] = $user_type;
				$p++;
			}

		for($i=0;$i<$cuser2;$i++){
		$k = $i+1;
		if($i==0){$txt .= "value$k=".$gpara[$i];}
		else {$txt .= "&value$k=".$gpara[$i];}
		
		}
		//echo $txt; //ตัวแปรนี้ใช้ส่งไปยังหน้ากราฟ
		
		$SQL_SELECT_MAN = "SELECT COUNT(user_id) FROM ag_user WHERE user_gender = 'ชาย' ;";
		$cman = mysql_query($SQL_SELECT_MAN);
		$cman2 = mysql_result($cman,0);
		
		$SQL_SELECT_WOMAN = "SELECT COUNT(user_id) FROM ag_user WHERE user_gender = 'หญิง' ;";
		$cwoman = mysql_query($SQL_SELECT_WOMAN);
		$cwoman2 = mysql_result($cwoman,0);
		
		$SQL_SELECT_MIN = "SELECT min(year(user_dateenter)) FROM ag_user ;";
		$min = mysql_query($SQL_SELECT_MIN);
		$minyear = mysql_result($min,0);
		$minyear += 543;
		$SQL_SELECT_MAX = "SELECT max(year(user_dateenter)) FROM ag_user ;";
		$max = mysql_query($SQL_SELECT_MAX);
		$maxyear = mysql_result($max,0);
		$maxyear += 543;
//		echo "<br>min => ".$min2;
//		echo "<br>max => ".$max2;
//$txtmonth = "";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ยินดีต้อนรับเข้าสู่ ระบบบริการสื่อมัลติมีเดียด้านการเกษตร</title>
<script type="text/javascript" language="JavaScript1.2" src="Scripts/popup.js"></script>
<link rel="stylesheet" href="standard.css" type="text/css" />
<script>  
	function chklogin(){
		if(document.frmLogin.user.value==''){
			alert('กรุณาใส่ Username');
			$code = '3';
			document.frmLogin.user.focus();
		} else if(document.frmLogin.passwd.value==''){
			alert('กรุณาใส่ Password');
			$code = '3';
			document.frmLogin.passwd.focus();
		} else {
			document.frmLogin.submit();
		}
}
</script>
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<?php 
function monthcv($month){

		switch($month) 
		{ 
		case "1":  $printmonth = "มกราคม"; 		break; 
		case "2":  $printmonth = "กุมภาพันธ์"; 		break; 
		case "3":  $printmonth = "มีนาคม"; 		break; 
		case "4":  $printmonth = "เมษายน"; 		break; 
		case "5":  $printmonth = "พฤษภาคม"; 	break; 
		case "6":  $printmonth = "มิถุนายน"; 		break; 
		case "7":  $printmonth = "กรกฏาคม"; 		break; 
		case "8":  $printmonth = "สิงหาคม"; 		break; 
		case "9":  $printmonth = "กันยายน"; 		break; 
		case "10": $printmonth = "ตุลาคม"; 		break; 
		case "11": $printmonth = "พฤศจิกายน"; 	break; 
		case "12": $printmonth = "ธันวาคม"; 		break; 
		case "มกราคม":  		$printmonth = "1"; 	break; 
		case "กุมภาพันธ์":  	$printmonth = "2"; 	break; 
		case "มีนาคม":  		$printmonth = "3"; 	break; 
		case "เมษายน":  		$printmonth = "4"; 	break; 
		case "พฤษภาคม":  	$printmonth = "5"; 	break; 
		case "มิถุนายน":  		$printmonth = "6"; 	break; 
		case "กรกฏาคม":  	$printmonth = "7"; 	break; 
		case "สิงหาคม":  		$printmonth = "8"; 	break; 
		case "กันยายน":  		$printmonth = "9"; 	break; 
		case "ตุลาคม": 		$printmonth = "10";	break; 
		case "พฤศจิกายน": 	$printmonth = "11"; break; 
		case "ธันวาคม": 		$printmonth = "12"; break; 
		}
	//return($month);
	return($printmonth);

}
?>
<script>
function chklistbox(){
	if(document.frm_report.selectYear.value=='0' && document.frm_report.selectMonth.value!='0'){
	alert('กรุณาเลือกปีที่ต้องการ');
	document.frm_report.selectYear.focus();
	return false;
	}else return true;
}
</script>
</head>

<body onLoad="MM_preloadImages('img/m_main2.jpg','img/m_register2.jpg','img/m_multimedia2.jpg','img/m_manual2.jpg','img/m_evaluate2.jpg','img/m_admin2.jpg','img/m_static2.jpg','img/m_topten2.jpg')">
<table width="1024" height="659" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#666600">
  <tr>
    <td height="215" align="center" valign="top" bgcolor="#CCCCCC"><table width="1024" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="170" background="img/headNew2.jpg" bgcolor="#FFFFFF">&nbsp;</td>
      </tr>
    </table>
        <table width="824" border="0" cellpadding="0" cellspacing="0" bordercolor="#FF0000">
          <tr>
            <td width="103" height="45" align="center"><a href="index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image12','','img/m_main2.jpg',1)"><img src="img/m_main.jpg" name="Image12" width="115" height="45" border="0" id="Image12" /></a></td>
            <td width="103" align="right"><a href="user_register.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image13','','img/m_register2.jpg',1)"><img src="img/m_register.jpg" name="Image13" width="115" height="45" border="0" id="Image13" /></a></td>
            <td width="103" align="right"><a href="vdo_list.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image14','','img/m_multimedia2.jpg',1)"><img 
src="img/m_multimedia.jpg" name="Image14" width="117" height="45" border="0" id="Image14" /></a></td>
            <td width="103"><a href="vdo_top10.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image11','','img/m_topten2.jpg',1)"><img 
src="img/m_topten.jpg" name="Image11" width="115" height="45" border="0" id="Image11" /></a></td>
            <td width="103"><a href="admin_report_search.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','img/m_static2.jpg',1)"><img 
src="img/m_static.jpg" name="Image10" width="215" height="45" border="0" id="Image10" /></a></td>
            <td width="103"><a href="manual.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','img/m_manual2.jpg',1)"><img src="img/m_manual.jpg" name="Image9" width="117" height="45" border="0" id="Image9" /></a></td>
            <td width="103"><a href="evaluate_overview.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','img/m_evaluate2.jpg',1)"><img src="img/m_evaluate.jpg" name="Image8" width="115" height="45" border="0" id="Image8" /></a></td>
            <td width="103"><a href="admin_login.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image15','','img/m_admin2.jpg',1)"><img src="img/m_admin.jpg" name="Image15" width="115" height="45" border="0" id="Image15" /></a></td>
          </tr>
        </table></td>
  </tr>
  <tr>
    <td width="1024" height="66" align="center" valign="top" bgcolor="#FFFFFF"><table width="1024" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="25" height="25" background="img/tb/tb_left_top.jpg">&nbsp;</td>
        <td height="25" background="img/tb/tb_top.jpg">&nbsp;</td>
        <td width="25" height="25" background="img/tb/tb_right_top.jpg">&nbsp;</td>
      </tr>
      <tr>
        <td width="25" align="left" background="img/tb/tb_left.jpg">&nbsp;</td>
        <td align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="30" align="left" bgcolor="#CCFF00" class="style7"><span class="scapmain style7">&nbsp;<img src="img/img05.gif" align="absbottom" /></span> รายงานสถิติการเข้าใช้งาน</td>
            <td align="right" bgcolor="#CCFF00" class="style7"><? if(isset($_SESSION["sess_Username"])){echo"<a href="."admin_logout.php"."><img src="."pic/logout(red)_icon.jpeg"." width='30' alt='ออกจากระบบ' border='0'/></a>";} ?></td>
          </tr>
          <tr>
            <td colspan="2" align="center" bgcolor="#FFFFFF"><table width="70%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" class="style24">                </td>
              </tr>
            </table>
              <p>&nbsp;</p>
<?php 			
				$txtyear = $_GET[selectYear];
				$txtyear = (int)$txtyear-(int)543;
				if($_GET[selectYear]==0){$txtyear = "";}
				$txtmonth = $_GET[selectMonth];
				if($_GET[selectMonth]=='0'){$txtmonth = "";}
			
			
				
			  /* select ปี */
			  $SQL_SELECT_YEAR = "SELECT  year(user_dateenter) as year from ag_user group by year(user_dateenter) order by year(user_dateenter)";
			  $result = mysql_query($SQL_SELECT_YEAR);
			  $count_year = 0;
			  while($rs = mysql_fetch_array( $result ))
			  {		
			  	  $year_arr[]=$rs[year]+543;
				  $count_year++;
				}
				
			  /* select เดือน */
			  $SQL_SELECT_MONTH = "SELECT  month(user_dateenter) as month from ag_user group by month(user_dateenter) order by month(user_dateenter)";
			  $result = mysql_query($SQL_SELECT_MONTH);
			  $count_month = 0;
			  while($rs = mysql_fetch_array( $result ))
			  {		
			  		$month=$rs[month];
				  switch($month) 
							{ 
							case "1":  $printmonth = "มกราคม"; 		break; 
							case "2":  $printmonth = "กุมภาพันธ์"; 		break; 
							case "3":  $printmonth = "มีนาคม"; 		break; 
							case "4":  $printmonth = "เมษายน"; 		break; 
							case "5":  $printmonth = "พฤษภาคม"; 	break; 
							case "6":  $printmonth = "มิถุนายน"; 		break; 
							case "7":  $printmonth = "กรกฏาคม"; 		break; 
							case "8":  $printmonth = "สิงหาคม"; 		break; 
							case "9":  $printmonth = "กันยายน"; 		break; 
							case "10": $printmonth = "ตุลาคม"; 		break; 
							case "11": $printmonth = "พฤศจิกายน"; 	break; 
							case "12": $printmonth = "ธันวาคม"; 		break; 
							case "มกราคม":  		$printmonth = "1"; 	break; 
							case "กุมภาพันธ์":  	$printmonth = "2"; 	break; 
							case "มีนาคม":  		$printmonth = "3"; 	break; 
							case "เมษายน":  		$printmonth = "4"; 	break; 
							case "พฤษภาคม":  	$printmonth = "5"; 	break; 
							case "มิถุนายน":  		$printmonth = "6"; 	break; 
							case "กรกฏาคม":  	$printmonth = "7"; 	break; 
							case "สิงหาคม":  		$printmonth = "8"; 	break; 
							case "กันยายน":  		$printmonth = "9"; 	break; 
							case "ตุลาคม": 		$printmonth = "10";	break; 
							case "พฤศจิกายน": 	$printmonth = "11"; break; 
							case "ธันวาคม": 		$printmonth = "12"; break; 
							}
					$month_arr[] =  $printmonth;
					$count_month++;
				}
				
?>
              <table width="50%" border="0" cellspacing="0" cellpadding="0">
              <form id="frm_report" name="frm_report" method="get" action="<?=$_SERVER['SCRIPT_NAME']?>" onSubmit="return chklistbox();">
                <tr>
                  <td width="30%" align="center" bgcolor="#CCFF00" class="style27">ปี                    
                  <select name="selectYear" id="selectYear" >
                    <option value="0" >-- ทั้งหมด --</option>
                   <?php 
					for($i=0;$i<$count_year;$i++){
					?>
                    <option value='<? echo $year_arr[$i];?>' <? if($_GET["selectYear"] == $year_arr[$i]) echo"selected"; ?>><? echo $year_arr[$i];?></option>
                    <?
					}
                    ?>
                  </select>                  </td>
                  <td width="30%" align="center" bgcolor="#CCFF00" class="style27">เดือน
                  <select name="selectMonth" id="selectMonth">
                    <option value="0"<? if($_GET["selectMonth"] == 0) echo"selected"; ?>>-- ทั้งหมด --</option>
                    <option value="01" <? if($_GET["selectMonth"] == '01') echo"selected"; ?>>มกราคม</option>
                     <option value="02" <? if($_GET["selectMonth"] == '02') echo"selected"; ?>>กุมภาพันธ์</option>
                      <option value="03" <? if($_GET["selectMonth"] == '03') echo"selected"; ?>>มีนาคม</option>
                       <option value="04" <? if($_GET["selectMonth"] == '04') echo"selected"; ?>>เมษายน</option>
                        <option value="05" <? if($_GET["selectMonth"] == '05') echo"selected"; ?>>พฤษภาคม</option>
                         <option value="06" <? if($_GET["selectMonth"] == '06') echo"selected"; ?>>มิถุนายน</option>
                          <option value="07" <? if($_GET["selectMonth"] == '07') echo"selected"; ?>>กรกฏาคม</option>
                           <option value="08" <? if($_GET["selectMonth"] == '08') echo"selected"; ?>>สิงหาคม</option>
                            <option value="09" <? if($_GET["selectMonth"] == '09') echo"selected"; ?>>กันยายน</option>
                            <option value="10" <? if($_GET["selectMonth"] == '10') echo"selected"; ?>>ตุลาคม</option>
                            <option value="11" <? if($_GET["selectMonth"] == '11') echo"selected"; ?>>พฤศจิกายน</option>
                            <option value="12" <? if($_GET["selectMonth"] == '12') echo"selected"; ?>>ธันวาคม</option>
                  </select>
                  </td>
                  <td width="30%" height="40" align="center" bgcolor="#CCFF00">
                  <input type="submit" name="btn_report" id="btn_report" value="ตกลง" /></td>
                </tr>
                 </form>
              </table>
              
              
             
              <p>&nbsp;</p>
              <table width="95%" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
                <tr>
                  <td align="center" valign="middle"><p>&nbsp;</p>
                    <table width="70%" height="190" border="0" cellpadding="0" cellspacing="0" bordercolor="#999999">
                    <tr>
                      <td align="center" valign="top" class=""><? /* ======================= ของจริง ======================= */
include "connectdb.php" ;
//$tb="ag_word"; 
mysql_select_db($dbname) or die("เลือกฐานข้อมูลไม่ได้"); /* ทําการเลือกฐานขอมูลกอน */ 

if($_GET[selectYear]==0 and $_GET[selectMonth]==0){ // user_edulv   user_anothertype
$sql="
SELECT count(user_ipaddress) as user_count,user_edulv,ag_usertype.user_typeid as user_typeid,user_type,user_agelength ,user_dateenter
FROM `ag_user` JOIN ag_usertype ON ag_user.user_typeid = ag_usertype.user_typeid 
GROUP BY  user_type , user_edulv , user_agelength 
ORDER BY user_typeid desc ,user_edulv asc ,user_agelength asc ,count(user_ipaddress)
"; 
}elseif($_GET[selectYear]==0 and $_GET[selectMonth]!=0){
$sql="
SELECT count(user_ipaddress) as user_count,user_edulv,ag_usertype.user_typeid as user_typeid,user_type,user_agelength ,user_dateenter
FROM `ag_user` JOIN ag_usertype ON ag_user.user_typeid = ag_usertype.user_typeid 
WHERE user_dateenter like '%".$txtyear."%' and user_dateenter like '%-".$txtmonth."-%'
GROUP BY  user_type , user_gender , user_agelength 
ORDER BY user_typeid desc ,user_edulv asc ,user_agelength asc ,count(user_ipaddress)
"; 
}elseif($_GET[selectYear]!=0 and $_GET[selectMonth]!=0){
$sql="
SELECT count(user_ipaddress) as user_count,user_edulv,ag_usertype.user_typeid as user_typeid,user_type,user_agelength ,user_dateenter
FROM `ag_user` JOIN ag_usertype ON ag_user.user_typeid = ag_usertype.user_typeid 
WHERE user_dateenter like '%".$txtyear."-".$txtmonth."-%'
GROUP BY  user_type , user_edulv , user_agelength 
ORDER BY user_typeid desc ,user_edulv asc ,user_agelength asc ,count(user_ipaddress)
"; 
}elseif($_GET[selectYear]!=0 and $_GET[selectMonth]==0){
$sql="
SELECT count(user_ipaddress) as user_count,user_edulv,ag_usertype.user_typeid as user_typeid,user_type,user_agelength ,user_dateenter
FROM `ag_user` JOIN ag_usertype ON ag_user.user_typeid = ag_usertype.user_typeid 
WHERE user_dateenter like '%".$txtyear."%'
GROUP BY  user_type , user_edulv , user_agelength 
ORDER BY user_typeid desc ,user_edulv asc ,user_agelength asc ,count(user_ipaddress)
"; 
}
$db_query=mysql_db_query($dbname,$sql);  
$num_rows=mysql_num_rows($db_query); /* นับ Reccord ทีพบ */

// echo"<center><br><div align='center' class='style8'>จํานวน $num_rows รายการ</div></center>"; 

if($num_rows=='0'){

		echo "ไม่พบข้อมูลผู้ใช้";
		
}else{
		if($_GET[selectYear]!=0){
			if($_GET[selectMonth]!=0){
			$month = monthcv($_GET[selectMonth]);
			$month = "<br>เดือน ".$month;
			}
			else{$month = "";}
		echo "รายงานผู้เข้าใช้บริการในปี ".$_GET[selectYear].$month;
		
		}else{
		echo "รายงานผู้เข้าใช้บริการในปี ".$minyear." - ".$maxyear;
		}
?>
                          <hr />
                          <table width="100%" height="45" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#999999">
                            <tr>
                              <td width="60"><div align="center" class="style24">ประเภทผู้ใช้งาน</div></td>
                              <td width="60"><div align="center" class="style24">ระดับการศึกษา</div></td>
                              <td width="60"><div align="center" class="style24">ช่วงอายุ</div></td>
                              <td width="50"><div align="center" class="style24">จำนวน</div></td>
                            </tr>
                          </table>
                        <hr />
                          <?						  
 
$a=0; 
$b=0; 

while($result = mysql_fetch_array($db_query)) 
{ 

$user_count			=$result[user_count]; 
$user_gender		=$result[user_gender];
$user_edulv			=$result[user_edulv];
$user_typeid		=$result[user_typeid]; 
$user_type			=$result[user_type]; 
$user_agelength		=$result[user_agelength]; 
$user_anothertype	=$result[user_anothertype]; 
$sumuser += $user_count;

if($user_typeid == 0){$user_type = $user_anothertype;}


if (($a % 2) == 0) {
$bgcolor=$colorzero;
}
else $bgcolor=$colorone;

//ตรวจสอบการแสดงผลซ้ำ//
if($mykey == $user_type){
$user_type = "";
$usertypecount_arr[$b-1] += $user_count;
}
elseif($mykey != $user_type){
$mykey = $user_type;

$usertypeid_arr[$b] = $user_typeid;		
$usertype_arr[$b] = $user_type;
$usertypecount_arr[$b] += $user_count;
$b++; 
}

?>
                          <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="">
                            <tr>
                              <td width="60" height="25" align="left" bgcolor=""><div align="center" class="style26"> <? echo"$user_type";?></div></td>
                              <td width="60" align="left" bgcolor=""><div align="center" class="style26"> &nbsp;&nbsp;<? echo"$user_edulv";?></div></td>
                              <td width="60" align="left" bgcolor=""><div align="center" class="style26"><? echo"$user_agelength";?></div></td>
                              <td width="50" align="center" bgcolor=""><div align="center" class="style26"><? echo"$user_count";?></div></td>
                            </tr>
                          </table>
                        <? 


$a++; 
} 

mysql_close(); 

?>
                          <hr />
                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td align="right"><table width="30%" border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td align="left" class="style26"><? for($i=0;$i<$b;$i++){echo "<br><br>".$usertype_arr[$i]."  จำนวน  <font color = red>".$usertypecount_arr[$i]."</font>  คน";} ?></td>
                                  </tr>
                                  <tr>
                                    <td align="left" class="style27"><hr />
                                        <? if($_GET[selectYear]!=0){echo "รวม ".$sumuser." คน ในปี ".$_GET[selectYear];}
									  		else {echo "รวม ".$sumuser." คน ในปี ".$minyear." - ".$maxyear;}
											 ?>
                                    </td>
                                  </tr>
                              </table></td>
                            </tr>
                          </table>
                        <hr />
                          <?php 
 }
  ?>
                      </td>
                    </tr>
                  </table>
                    <p>&nbsp;</p></td>
                </tr>
              </table>
              <p>&nbsp;</p>
              <p>&nbsp;</p>
              </td>
          </tr>
          <tr>
            <td height="25" colspan="2" bgcolor="#CCFF00">&nbsp;</td>
          </tr>
        </table></td>
        <td width="25" align="right" background="img/tb/tb_right.jpg">&nbsp;</td>
      </tr>
      <tr>
        <td width="25" height="25" background="img/tb/tb_left_foot.jpg">&nbsp;</td>
        <td height="25" background="img/tb/tb_foot.jpg">&nbsp;</td>
        <td width="25" height="25" background="img/tb/tb_right_foot.jpg">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td width="1024" align="center" valign="bottom"><table width="50%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="25">&nbsp;</td>
      </tr>
    </table>
        <table width="1024" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="50"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="25" height="25" background="img/tb/tb_left_top.jpg">&nbsp;</td>
                  <td background="img/tb/tb_top.jpg">&nbsp;</td>
                  <td width="25" height="25" background="img/tb/tb_right_top.jpg">&nbsp;</td>
                </tr>
                <tr>
                  <td width="25" align="left" background="img/tb/tb_left.jpg">&nbsp;</td>
                  <td height="25" align="center" valign="middle" bgcolor="#CCFF00"><table width="96%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td height="25" align="center"><strong>ศูนย์ความรู้ด้านการเกษตร สำนักหอสมุด มหาวิทยาลัยเกษตรศาสตร์</strong></td>
                      </tr>
                  </table></td>
                  <td width="25" align="right" background="img/tb/tb_right.jpg">&nbsp;</td>
                </tr>
                <tr>
                  <td width="25" height="25" background="img/tb/tb_left_foot.jpg">&nbsp;</td>
                  <td background="img/tb/tb_foot.jpg">&nbsp;</td>
                  <td width="25" height="25" background="img/tb/tb_right_foot.jpg">&nbsp;</td>
                </tr>
            </table></td>
          </tr>
      </table></td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>
